package com.ymatou.iapi.liveseller.testcase;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.liveseller.parameter.ResumeLiveProductBean;
import com.ymatou.iapi.liveseller.service.ResumeLiveProductCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.CounterCallService;
import com.ymttest.business.service.LiveRoomCallService;
import com.ymttest.business.service.ProductManagerCallServiceV2;
import com.ymttest.database.annotation.SqlMapperFactory;
import com.ymttest.database.model.LiveRoom;
import com.ymttest.database.model.Userinfo;
import com.ymttest.database.sqlwapper.JUserWapper;
import com.ymttest.database.sqlwapper.LiveRoomWapper;
/**
*开始销售商品
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ResumeLiveProduct{
	private static ResumeLiveProductBean resumeliveproductBean;
	private static ResumeLiveProductCall resumeliveproductCall;
	private static LiveRoomWapper liveRoomWapper;
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("开始销售商品");
	}

	@Before
	public void caseUp() {
		resumeliveproductBean=new ResumeLiveProductBean();
		resumeliveproductCall=new ResumeLiveProductCall();
		liveRoomWapper=new LiveRoomWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(resumeliveproductCall.getOpurl());
		liveRoomWapper=null;
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ResumeLiveProduct_001() {
		Logger.start(true,"status0未开始直播开始销售商品成功（暂停再开始）");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			//SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(uinfo.getUserId());
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(1, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(1, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ResumeLiveProduct_002() {
		Logger.start(true,"不输入liveid失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
//			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("400", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyEquals("直播Id参数错误", resumeliveproductCall.getString("Msg"), "验证Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ResumeLiveProduct_003() {
		Logger.start(true,"不输入ProductIdList失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
//			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("400", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyIsContains("商品Id至少需要一个", resumeliveproductCall.getString("Msg"), "验证Msg");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_004() {
		Logger.start(true,"liveid和ProductId不匹配不操作");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid+1);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(0, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(0, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ResumeLiveProduct_005() {
		Logger.start(true,"ProductId不存在不操作");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid+1);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(0, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(0, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_009() {
		Logger.start(true,"status9直播推流结束开始销售商品失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			liveRoomWapper.updateLiveRoomPushStatus(createlive.getId(), 9);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("201", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyEquals("直播已关闭或已结束", resumeliveproductCall.getString("Msg"), "验证Msg");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_010() {
		Logger.start(true,"status2推流直播开始销售商品成功");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			//SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(uinfo.getUserId());
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			LiveRoomCallService.SellerLiveOnline(createlive.getId(), createlive.getUserId());
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(1, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(1, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_011() {
		Logger.start(true,"status3断流直播开始销售商品成功");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			//SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(uinfo.getUserId());
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			LiveRoomCallService.SellerLiveOnline(createlive.getId(), createlive.getUserId());
			liveRoomWapper.updateLiveRoomPushStatus(createlive.getId(), 3);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(1, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(1, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ResumeLiveProduct_012() {
		Logger.start(true,"开始销售多个商品成功");
		try {
			List<Userinfo> list = new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			List<String> ProductIdList = new ArrayList<>();
			int count = 2;
			for (int i = 0; i < count; i++) {
				String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
				
				Logger.comment("创建商品：" + pid);
				ProductIdList.add(pid);
			}
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), ProductIdList);
			
			resumeliveproductBean.setLiveId(createlive.getId());
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			for (String pid : ProductIdList) {
				List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
				Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
				Logger.verifyEquals(1, listm.get(0).get("Status"), "验证Status暂停");
				Logger.debug(listm);
			}
			
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(ProductIdList.size(), liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(ProductIdList.size(), liveroom.getLiveProductNum(), "验证LiveProductNum");	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_013() {
		Logger.start(true,"status7系统自动关闭直播推流结束开始销售商品失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			liveRoomWapper.updateLiveRoomPushStatus(createlive.getId(), 7);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("201", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyEquals("直播已关闭或已结束", resumeliveproductCall.getString("Msg"), "验证Msg");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_014() {
		Logger.start(true,"status8未推流关闭直播推流结束开始销售商品失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			liveRoomWapper.updateLiveRoomPushStatus(createlive.getId(), 8);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("201", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyEquals("直播已关闭或已结束", resumeliveproductCall.getString("Msg"), "验证Msg");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_ResumeLiveProduct_015() {
		Logger.start(true,"status10运营关闭直播推流结束开始销售商品失败");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			liveRoomWapper.updateLiveRoomPushStatus(createlive.getId(), 10);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);
			resumeliveproductCall.callService();			
			Logger.verifyEquals("201", resumeliveproductCall.getString("Code"), "验证Code");
			Logger.verifyEquals("直播已关闭或已结束", resumeliveproductCall.getString("Msg"), "验证Msg");	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ResumeLiveProduct_016() {
		Logger.start(true,"status0未开始直播开始销售商品成功（暂停再开始）、计数器+1");
		try {
			List<Userinfo> list =new JUserWapper().select1KSeller();
			Userinfo uinfo = list.get(0);
			//SqlMapperFactory.getIntergratedProductMapper().updateProductoffSale(uinfo.getUserId());
			String pid =ProductManagerCallServiceV2.getNewProductId(uinfo.getLoginId(), uinfo.getUserId(), 10);
			
			Logger.comment("创建商品：" + pid);
			LiveRoom createlive = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(uinfo));
			LiveRoomCallService.AddProductsToLive(createlive.getId(), createlive.getUserId(), pid);
			LiveRoomCallService.SuspendLiveProduct(createlive.getId(), pid);
			resumeliveproductBean.setLiveId(createlive.getId());
			List<String> ProductIdList=new ArrayList<>();
			ProductIdList.add(pid);
			resumeliveproductBean.setProductIds(ProductIdList);
			resumeliveproductCall.setData(resumeliveproductBean);

			Integer counter = CounterCallService.getSingleValueByLiveId(createlive.getId());
			resumeliveproductCall.callService();	
			Integer counter1 = CounterCallService.getSingleValueByLiveId(createlive.getId());
			Logger.verifyEquals(counter+1, counter1, "添加商品之后，计数器+1");
			
			Logger.verifyEquals("200", resumeliveproductCall.getString("Code"), "验证Code");
			List<Map> listm = liveRoomWapper.selectLiveproductByIdAndPid(createlive.getId(), pid);
			Logger.verifyEquals(1, listm.size(), "验证商品记录加入到数据库");
			Logger.verifyEquals(1, listm.get(0).get("Status"), "验证Status暂停");
			Logger.debug(listm);
			
			LiveRoom liveroom = liveRoomWapper.selectLiveRoomById(createlive.getId());
			Logger.verifyEquals(1, liveroom.getPutawayCount(), "验证PutawayCount");
			Logger.verifyEquals(1, liveroom.getLiveProductNum(), "验证LiveProductNum");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
}